package com.ssy.lingxi.platform.manage.handler.init;

import com.ssy.lingxi.platform.manage.service.IUnitService;
import lombok.Data;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 服务启动时单位缓存到redis
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/7/29
 */
@Data
@Component
public class UnitHandler implements ApplicationRunner {

    @Resource
    private IUnitService unitService;

    @Override
    public void run(ApplicationArguments args) {
        unitService.initToRedis();
    }
}
